package com.patterns.observer;

import java.io.File;

/**
 * 具体观察者
 * 收到通知记录一条日志
 * @author fwj
 * @date 2021/4/21 18:14
 **/
public class LogListener implements EventListener{

    private String log;

    public LogListener(String fileName) {
        this.log = fileName;
    }

    @Override
    public void update(String eventType, File file) {
        System.out.println("Save to log " + log + ": Someone has performed " + eventType + " operation with the following file: " + file.getName());
    }

}
